package com.lvchangqi.entity;

import javax.persistence.*;

/**
 * Created by version on 17-6-23.
 */
@Entity
@Table(name = "leaves", schema = "wxmini")
public class LeaveEntity {
    private Integer id;
    private String dormitory; //寝室
    private String end; //结束时间 需要转换
    private String from; //开始时间 需要转换
    private String name; //姓名
    private String phone_m; //自己的号码
    private String phone_p; //家长的号码
    private String reason; //请假理由
    private String clazz; //班级
    private Integer types; //类型 需要转换
    private Integer s_id;
    private Integer t_version;
    private Integer l_version;
    private String url;
    private String reject;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "dormitory")
    public String getDormitory() {
        return dormitory;
    }

    public void setDormitory(String dormitory) {
        this.dormitory = dormitory;
    }

    @Basic
    @Column(name = "[end]")
    public String getEnd() {
        return end;
    }

    public void setEnd(String end) {
        this.end = end;
    }

    @Basic
    @Column(name = "[from]")
    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "phone_m")
    public String getPhone_m() {
        return phone_m;
    }

    public void setPhone_m(String phone_m) {
        this.phone_m = phone_m;
    }

    @Basic
    @Column(name = "phone_p")
    public String getPhone_p() {
        return phone_p;
    }

    public void setPhone_p(String phone_p) {
        this.phone_p = phone_p;
    }

    @Basic
    @Column(name = "reason")
    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    @Basic
    @Column(name = "clazz")
    public String getClazz() {
        return clazz;
    }

    public void setClazz(String clazz) {
        this.clazz = clazz;
    }

    @Basic
    @Column(name = "types")
    public Integer getTypes() {
        return types;
    }

    public void setTypes(Integer types) {
        this.types = types;
    }

    @Basic
    @Column(name = "s_id")
    public Integer getS_id() {
        return s_id;
    }

    public void setS_id(Integer s_id) {
        this.s_id = s_id;
    }

    @Basic
    @Column(name = "t_version")
    public Integer getT_version() {
        return t_version;
    }

    public void setT_version(Integer t_version) {
        this.t_version = t_version;
    }

    @Basic
    @Column(name = "l_version")
    public Integer getL_version() {
        return l_version;
    }

    public void setL_version(Integer l_version) {
        this.l_version = l_version;
    }

    @Basic
    @Column(name = "url")
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Basic
    @Column(name = "reject")
    public String getReject() {
        return reject;
    }

    public void setReject(String reject) {
        this.reject = reject;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        LeaveEntity that = (LeaveEntity) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (dormitory != null ? !dormitory.equals(that.dormitory) : that.dormitory != null)
            return false;
        if (end != null ? !end.equals(that.end) : that.end != null) return false;
        if (from != null ? !from.equals(that.from) : that.from != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (phone_m != null ? !phone_m.equals(that.phone_m) : that.phone_m != null) return false;
        if (phone_p != null ? !phone_p.equals(that.phone_p) : that.phone_p != null) return false;
        if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
        if (clazz != null ? !clazz.equals(that.clazz) : that.clazz != null) return false;
        if (types != null ? !types.equals(that.types) : that.types != null) return false;
        if (s_id != null ? !s_id.equals(that.s_id) : that.s_id != null) return false;
        if (t_version != null ? !t_version.equals(that.t_version) : that.t_version != null)
            return false;
        if (l_version != null ? !l_version.equals(that.l_version) : that.l_version != null)
            return false;
        if (url != null ? !url.equals(that.url) : that.url != null) return false;
        return reject != null ? reject.equals(that.reject) : that.reject == null;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (dormitory != null ? dormitory.hashCode() : 0);
        result = 31 * result + (end != null ? end.hashCode() : 0);
        result = 31 * result + (from != null ? from.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (phone_m != null ? phone_m.hashCode() : 0);
        result = 31 * result + (phone_p != null ? phone_p.hashCode() : 0);
        result = 31 * result + (reason != null ? reason.hashCode() : 0);
        result = 31 * result + (clazz != null ? clazz.hashCode() : 0);
        result = 31 * result + (types != null ? types.hashCode() : 0);
        result = 31 * result + (s_id != null ? s_id.hashCode() : 0);
        result = 31 * result + (t_version != null ? t_version.hashCode() : 0);
        result = 31 * result + (l_version != null ? l_version.hashCode() : 0);
        result = 31 * result + (url != null ? url.hashCode() : 0);
        result = 31 * result + (reject != null ? reject.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "LeaveEntity{" +
                "id=" + id +
                ", dormitory='" + dormitory + '\'' +
                ", end='" + end + '\'' +
                ", from='" + from + '\'' +
                ", name='" + name + '\'' +
                ", phone_m='" + phone_m + '\'' +
                ", phone_p='" + phone_p + '\'' +
                ", reason='" + reason + '\'' +
                ", clazz='" + clazz + '\'' +
                ", types=" + types +
                ", s_id=" + s_id +
                ", t_version=" + t_version +
                ", l_version=" + l_version +
                ", url='" + url + '\'' +
                ", reject='" + reject + '\'' +
                '}';
    }
}
